<template>
<PersonDetailsHeader title="人才详情"/>
  <div class="details">
    <div class="left">
      <img :src="personDetails?.image" alt="">
    </div>
    <div class="right">
      <p class="name">{{personDetails?.name}}</p>
      <p class="info">{{personDetails?.sex}}<span>|</span>{{personDetails?.age}}<span>|</span>{{personDetails.birthday}}<span>|</span>{{personDetails.education}}</p>
      <p class="work">工作经验{{personDetails?.age}}</p>
      <p class="price">{{personDetails?.price}}元/月</p>
    </div>
  </div>
  <div class="introduce">
    <h3>个人介绍</h3>
    <p>{{personDetails?.descs}}</p>
  </div>
  <div class="btn-content">
    <div class="btn">立即联系</div>
  </div>
</template>

<script setup lang="ts">
import {useRoute} from "vue-router";
import PersonDetailsHeader from "@/components/PubHeaderComponent.vue"
import {onMounted, ref} from "vue";
import {getPersonDetails} from "@/api/Person/person";
const route=useRoute()
interface IPersonDetails {
  id:number,
  image:string,
  name:string,
  age:string,
  price:string,
  descs:string,
  sex:string,
  birthday:string,
  education:string,
}
const personDetails = ref<IPersonDetails[]>([])
onMounted(async () => {
  const res=await getPersonDetails({id:route.params.id})
  if(res.status===200){
    personDetails.value=res.data
  }
})
</script>

<style scoped lang="less">
.details{
  display:flex;
  background-color: #fff;
  padding: 10px;
  box-sizing: border-box;
  .left{
    img{
      width: 100px;
      border-radius: 5px;
    }
  }
  .right{
    padding: 10px;
    line-height: 30px;
    .name{
      font-size:15px;
      font-weight: 700;
    }
    .info{
      font-size: 14px;
      color: #999;
      span{
        padding: 0 5px;
      }
    }
    .work{
      font-size:14px;
      color: #999;
    }
    .price{
      font-size: 14px;
      color: #ff4444;
    }
  }
}
.introduce{
  background-color: #fff;
  margin-top: 10px;
  padding: 10px;
  h3{
    font-size: 16px;
    padding: 10px 0;
  }
  p{
    font-size: 14px;
    color: #999;
    letter-spacing: 1.5px;
  }
}
.btn-content{
  width: 100%;
  text-align: center;
  margin: 30px 0;
  .btn{
    width: 90%;
    height:40px;
    line-height: 40px;
    border-radius: 5px;
    background-color: #694886;
    color: #fff;
    margin: 0 auto;
  }
}
</style>